<?php

class ForumsController extends AppController {

	var $name = 'Forums';
	
	var $helpers = array('Html', 'Javascript', 'Ajax', 'Time');

	function index() {
		$this->set('forums', $this->Forum->findAll());
	}
	
	function view($forum_id = null) {
		if ($forum_id == null) {
			$this->redirect('/forums/');
		} else {
			$topics = $this->Forum->Topic->findAll('forum_id = ' . $forum_id, null, 'Topic.modified DESC');
			$this->set('topics', $topics);
		}
	}

}

?>